package com.mingdao.lhy.service;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mingdao.lhy.mapper.wish.SpecialProjectAndArtSpecialtyMapper;
import com.mingdao.lhy.mapper.wish.ZkwMapper;
import com.mingdao.lhy.pojo.ArtSpecialty;
import com.mingdao.lhy.pojo.SpecialProject;
import com.mingdao.lhy.pojo.Zkw;

//@Service, @Controller，@Repository = {@Component + 一些特殊的functionality}
@Service
public class StateServiceImpl implements StateService {
	private static Logger log = LoggerFactory.getLogger(StateServiceImpl.class);

	@Autowired
	private ZkwMapper zkwMapper;

	@Autowired
	private SpecialProjectAndArtSpecialtyMapper specialProjectAndArtSpecialtyMapper;

	@Override
	@Transactional
	public int changePassword(Zkw zkw) {
		int i = zkwMapper.updatePasswordByPrimaryKey(zkw);
		return i;
	}

	@Override
	public List<ArtSpecialty> getArtSpecialty() {

		List<ArtSpecialty> artSpecialtys = specialProjectAndArtSpecialtyMapper.getArtSpecialty();
		return artSpecialtys;
	}

	@Override
	public List<SpecialProject> getSpecialProject() {
		List<SpecialProject> featuredItems = specialProjectAndArtSpecialtyMapper.getSpecialProject();
		return featuredItems;
	}
}
